<php>
$_REQUEST['goPageFun']="goPageBSub";//设定分页调用函数

$bsub_area_id	= $_REQUEST['area_id'];	//区域id	
$bsub_city_id	= $_REQUEST['city_id'];	//城市id
//$bsub_bsubpage 	= service('Statistics')->statPartner4Checked(array('pid'=>$_SESSION['qp_id'],'rtntype'=>'normal'),'down',true,10);
$bsub_bsubpage 	= D('Partner','Admin')->selectPartnerInfo(array('porppid'=>$_SESSION['qp_id'],'noroot'=>'yes'),'*',' parent_id asc ',10,true);
if(empty($bsub_bsubpage)||empty($bsub_bsubpage['data'])){
</php>
	<div class="addr-box">
		<div class="page_box">无分店数据！</div>
	</div>
<php>}else{
$index=0;</php>
</php>
	<volist id="vo" name="bsub_bsubpage['data']">
		<div class="addr-box" id='addr_drief'>
        	<dl onclick="
        		<php>$latlng = explode(',',$vo['location']);</php>
				<php>if(!empty($latlng[0])&&!empty($latlng[1])){</php>
				showBsubInfo({$index});
				//$(this).parent().addClass('addr-box_on');
				<php>
				$index=$index+1;
				}else{</php>
				k_error('未标定 {$vo['title']} 坐标！')
        		<php>}</php>
        	">
	            <dt>
	            	<div style="padding-left:0px;width:20px;float:left;" class="seq">{$i}</div>
	            	<div style="padding-left:0px;width:165px;float:left;overflow:hidden;" title="{$vo['title']}" >{$vo['title']}</div>
	            	<a href="{:U('shanghu://Statis/index',array('statmodel'=>'shanghu','checkerid'=>$vo['id']))}">
	            		<img width="20" height="20" style="float:right;margin-right: 0;padding-top: 3px;" 
	            				src="/Public/shanghu/images/chart_32.png" style="vertical-align: middle;">
	            	</a>
	            </dt>
	            <div id="clear"></div>
	            <dd><span class="addr">地址:</span>{$vo['address']}</dd>
	            <dd><span class="phone">电话:</span>{$vo['phone']}/{$vo['mobile']}</dd>
            </dl>
        </div>
	</volist>
	
	<div id="clear"></div>
	
	<style>.page_box_s a {font-weight: normal;}</style>
	<div class="addr-box" style="border-bottom: 0px solid #E6E6E6;">
		<div class="page_box_s">{$bsub_bsubpage['html']}</div>
	</div>
<php>}</php>	
<div id="bsub_search_data" style="display:none;">
<input type="hidden" id="brandid" value="{$bsub_brandid}">
<input type="hidden" id="area_id" value="{$bsub_area_id}">
<input type="hidden" id="city_id" value="{$bsub_city_id}">
</div>
<script type="text/javascript">
	$(document).ready(function(){
		initializeMarkers();
		initstyle();
	});
	
	function initializeMarkers() {
		deleteOverlays();//清空现有标记
		<volist id="vo" name="bsub_bsubpage['data']">
		<php>$latlng = explode(',',$vo['location']);</php>
		<php>if(!empty($latlng[0])&&!empty($latlng[1])){</php>
		addBsubMarker('{$latlng[0]}','{$latlng[1]}','{$vo['title']}','{$vo['address']}','{$vo['phone']}/{$vo['mobile']}');
		<php>}</php>
		</volist>
	}
	
	function addBsubMarker(lat,lng,title,address,phone){
	  	var bLatlng = new google.maps.LatLng(lat, lng);
	  	var contentString = '<div id="content">'+
	  	'<div id="siteNotice">'+
	  	'</div>'+
	  	'<h3 id="firstHeading" style="border-bottom: 1px solid #9CB8CC;color: #333333;font-size: 14px;line-height: 22px;margin:0;padding: 0;">'+title+'</h3>'+
	  	'<div >'+
	  	'<p style=\'line-height:22px;color: #7D7D7D;margin: 3px 0 0 0; padding: 0;\'>地址：'+address+'</p>'+
	  	'<p style=\'line-height:22px;color: #7D7D7D;margin: 0; padding: 0;\'>电话：'+phone+'</p>'+
	  	'</div>'+
	  	'</div>';
	
		var infowindow = new google.maps.InfoWindow({
		  	content: contentString
		});
		
		var marker = new google.maps.Marker({
		  	position: bLatlng,
		  	map: map,
		  	title:title
		});
		
		google.maps.event.addListener(marker, 'click', function() {
			setMapCenter(marker.getPosition());
			infowindow.open(map,marker);
		});
		//setMapCenter(marker.getPosition());
		//infowindow.open(map,marker);
		markersArray.push(marker);
		infowinArray.push(infowindow);
  	}
</script>